1. Field of the Invention
The present invention relates to a file system of a randomly accessible storage device, and more particularly, to a file system for a storage device accessed by a plurality of channels.
2. Description of the Related Art
In recent years, digitization of broadcasting has been rapidly advancing. In Japan, full-scale digital broadcasting services were launched at the end of 2000, and also ground wave digital broadcasting is planned to make its debut. With the digitization of broadcasting, also a video recording method has been digitized. A variety of storage devices for storing MPEG videos of a digital broadcast are proposed. For example, the storage devices for storing MPEG videos are not only a sequentially accessible medium such as a D-VHS which is one type of VTR, but also a randomly accessible medium such as an MO, an HDD, etc., which have been used for a PC so far.
As a medium recording a video, a sequential access medium such as a VTR has been chiefly used. However, a randomly accessible medium such as an HDD, a magneto-optical disk, etc. has been attracting public attention as a video storage medium in recent years. A video storage medium implemented by the randomly accessible medium is expected to provide brand-new video applications such as simultaneous recording/reproduction of a plurality of channels, time-shifting reproduction, etc.
To a sequential access medium, only a unidirectional access can be made. In the meantime, the above described randomly accessible medium is characterized in that any location within the medium can be accessed freely. By taking advantage of the upside of this randomly accessible medium, new applications implementing operations such as simultaneous recording/reproduction of videos of a plurality of channels, time shifting such as time-shifting reproduction, a fast jump to a desired location, editing within the same medium, etc. are under study.
When a plurality of channels are simultaneously processed or time-shifting-reproduced, video data of the plurality of channels must be simultaneously recorded/reproduced. In this case, the video data of all of the channels must be processed without delay. Accordingly, the data must be read/written from/to the medium until the buffer for video data of each channel underflows or overflows.
Therefore, when videos of a plurality of channels are handled, a method interleaving and storing videos in an order of nearer processing time limits, or a method partitioning an area for each video, and sequentially storing the video within a medium is conventionally used.
FIG. 1 exemplifies the configuration of a file system when videos of a plurality of channels are interleaved and stored. The file system 10 shown in this figure comprises an accessing unit 11, a block searching unit 12, a block allocating unit 13, and a block table 14.
Additionally, the file system 10 for a storage device recording/reproducing a plurality of channels allocates a buffer 20 for each channel (for each recording/reproduction in the case of time-shifting reproduction, etc.) of a video to be recorded/reproduced, and issues an input/output request to an external storage device in an order of nearer processing time limits by recognizing a time point at which the buffer overflows (at the time of recording) or underflows (at the time of reproduction) to be a processing time limit.
The accessing unit 11 calls the block searching unit 12 and the block allocating unit 13 in response to a video recording/reproduction request, and instructs the external storage device to read/write video data based on these notifications. The block searching unit 12 is called by the accessing unit 11 at the time of reproduction, and notifies the accessing unit 11 of the block in which the video data to be reproduced is stored by referencing the block table 14. Note that a block referred to in this specification indicates a minimum logical recording unit when the file system instructs the external storage device to read/write data. The block allocating unit 13 is called by the accessing unit at the time of recording, and notifies the accessing unit 11 of an empty area for storing the video by referencing the block table 14. The block table 14 is a table that manages the storage area of the external storage device in units of blocks, and also manages which video data is stored in each block.
When a video is reproduced, a video reproduction request is first issued to the accessing unit 11 [(1)]. In response to this request, the accessing unit 11 calls the block searching unit 12 [(2)-1]. The block searching unit 12 references the block table 14 [(3)-1], searches for the block allocated to the data to be read [(4)-1], and notifies the accessing unit 11 of the searched block [(5)-1]. The accessing unit 11 then instructs the external storage device to read the data from this block, so that the data within the corresponding block is written to the buffer [(6)].
Similarly, when a video is recorded, a video recording request is first issued to the accessing unit 11 [(1)]. In response to this request, the accessing unit 11 calls the block allocating unit 13 [(2)-2]. The block allocating unit 13 references the block table 14 [(3)-2], and searches for a block yet to be allocated [(4)-2]. The block allocating unit 13 then allocates the block yet to be allocated as a block in which the video data is to be stored, and notifies the accessing unit 11 of the allocated block [(5)-2]. Lastly, the accessing unit 11 instructs the external storage device to write the data, so that the data within the buffer is written to the allocated block [(6)].
FIGS. 2A and 2B explain the fragmentation of a storage area when videos of a plurality of channels are interleaved and stored.
If data is interleaved and stored in a device which simultaneously processes videos of a plurality of channels, the video data are sequentially written to an external storage device in an order of nearer processing time limits in a buffer. If the videos are repeatedly recorded/reproduced or erased by changing the number of channels to be recorded and/or an encoding rate of each channel, a storage area is fragmented.
FIGS. 2A and 2B show the states of a storage area within a medium in the case where after video data from three channels are recorded, one piece of video data is erased, and video data is newly recorded from a different channel. FIG. 2A shows the state of the storage area in the case where videos A, B, and C with the same encoding rate are sequentially recorded in a medium by being switched from a video A, a video B, to a video C, . . . in an order of nearer processing time limits in the video buffer 20. In the meantime, FIG. 2B shows the state of the storage area in the case where a video D with an encoding rate that is higher than that of the video C is newly recorded, after the data of the video C is erased from the state shown in FIG. 2A.
If data are repeatedly written in an interleaving manner or erased while changing an encoding rate or the number of channels as shown in FIG. 2B, an empty area within the storage area is fragmented into a plurality of smaller areas. If the size of an empty area is fragmented into a size that cannot store a video, storage efficiency is degraded.
For example, FIG. 2B shows the case where after the data of the video C is erased from the state of FIG. 2A, in which the videos A, B, and C are stored in the storage area, the video D with the encoding rate higher than that of the video C is recorded. Because the encoding rate of the video D is higher than that of the video C, the size of the data of the video D, which is stored at one time, is larger than that of the data of the video C. Accordingly, the size of the area emptied by erasing the video C is too small to record the data of the video D. The data of the video D is therefore stored in another larger empty area. If the number of channels is changed, or if videos with different encoding rates are repeatedly recorded/reproduced as described above, the number of unavailable fragmented areas increases, leading to degradation in the storage efficiency. Finally, a defragmentation process for gathering fragmented empty areas must be performed.
Next, a method partitioning a storage area for respective videos within a medium, and sequentially storing the videos is explained with reference to FIGS. 3A and 3B.
With the method shown in FIGS. 3A and 3B, a storage area is partitioned into a plurality of areas, which are allocated to respective videos.
FIG. 3A shows the state where videos A, B, and C with the same encoding rate are stored in respective areas, whereas FIG. 3B shows the case where data of a video D is newly stored after part of the video C is erased from the state shown in FIG. 3A by being edited.
The method partitioning a storage area and storing videos is a method storing only video type in a collected area. Therefore, even if an empty space is generated by being edited as shown in FIG. 3B, and the total sum of this area has a capacity that can store the video D, the data of the video D cannot be stored in this storage area. If the video D is newly stored, an area for the video D must be secured.
If recording, reproduction, or erasure is repeated also when a storage area is partitioned for videos, which are sequentially stored in these areas, an empty area is repeatedly fragmented. As a result, it becomes impossible to secure a collected area in which data can be sequentially recorded, so that the need for making defragmentation arises.